package com.netbao.fin.vomapper;

import com.netbao.fin.model.Invoice;
import com.netbao.fin.model.Subtotal;
import com.netbao.model.PageBean;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author suqk
 * @create 2019-11-06 14:41
 */
public interface JieVoMapper {
    @Results({@Result(column = "cname",property = "captain.cname"),@Result(column = "phone",property = "captain.phone"),@Result(column = "cdeposit_bank",property = "captain.cdepositBank"),@Result(column = "account",property = "captain.account")})
    @Select("SELECT s.id,s.eid,c.cname,c.phone,s.ctotal,s.cstatus,s.idcard,s.`payment`,c.`cdeposit_bank`,c.`account`,s.`account`,s.`creason`,s.`price`,s.`proid`,s.`paystatus`,s.`piaostatus`,s.`piaonum`,s.`shentime` FROM veh_captain c,fin_subtotal s WHERE c.`phone`=s.`account` and s.cstatus=3 and s.eid=#{eid}")
    List<Subtotal> listAll(PageBean pageBean, Long eid);
    @Results({@Result(column = "cname",property = "captain.cname"),@Result(column = "phone",property = "captain.phone"),@Result(column = "cdeposit_bank",property = "captain.cdepositBank"),@Result(column = "account",property = "captain.account")})
    @Select("SELECT s.id,s.eid,c.cname,c.phone,s.ctotal,s.cstatus,s.idcard,s.`payment`,c.`cdeposit_bank`,c.`account`,s.`account`,s.`creason`,s.`price`,s.`proid`,s.`paystatus`,s.`piaostatus`,s.`piaonum`,s.`shentime` FROM veh_captain c,fin_subtotal s WHERE c.`phone`=s.`account` and s.cstatus=3 and c.cname like '%${name}%' and s.eid=#{eid}")
    List<Subtotal> mo(PageBean pageBean, String name, Long eid);
    @Select("select * from fin_invoice where eid=#{eid}")
    List<Invoice> list(Long eid);
    @Results({@Result(column = "cname",property = "captain.cname"),@Result(column = "phone",property = "captain.phone"),@Result(column = "cdeposit_bank",property = "captain.cdepositBank"),@Result(column = "account",property = "captain.account")})
    @Select("SELECT s.id,s.eid,c.cname,c.phone,s.ctotal,s.cstatus,s.idcard,s.`payment`,c.`cdeposit_bank`,c.`account`,s.`account`,s.`creason`,s.`price`,s.`proid`,s.`paystatus`,s.`piaostatus`,s.`piaonum`,s.`shentime` FROM veh_captain c,fin_subtotal s WHERE c.`phone`=s.`account` and s.cstatus=3 and s.shentime like '${date}%' and s.eid=#{eid}")
    List<Subtotal> cha(String date, PageBean pageBean, Long eid);
    @Results({@Result(column = "cname",property = "captain.cname"),@Result(column = "phone",property = "captain.phone"),@Result(column = "cdeposit_bank",property = "captain.cdepositBank"),@Result(column = "account",property = "captain.account")})
    @Select("SELECT s.id,s.eid,c.cname,c.phone,s.ctotal,s.cstatus,s.idcard,s.`payment`,c.`cdeposit_bank`,c.`account`,s.`account`,s.`creason`,s.`price`,s.`proid`,s.`paystatus`,s.`piaostatus`,s.`piaonum`,s.`shentime` FROM veh_captain c,fin_subtotal s WHERE c.`phone`=s.`account` and s.cstatus=3 and s.shentime='${date}' and s.eid=#{eid}")
    List<Subtotal> cha1(String date, PageBean pageBean, Long eid);
}
